/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.register.Controller;

import java.io.File;



/**
 *
 * @author Yogesh
 */
public class MakeDirectory implements Runnable{

    Thread t;
    File file;

    public MakeDirectory(String name) {

        t=new Thread(this, name);
        t.start();

    }



    public void run() {

        file = new File("VehicleHai/"+t.getName());
	if (!file.exists()) {
		if (file.mkdir()) {
			System.out.println("Directory is created!");
		} else {
			System.out.println("Failed to create directory!");
		}
	}

        file = new File("VehicleHai/"+t.getName()+"/Insurance");
	if (!file.exists()) {
		if (file.mkdir()) {
			System.out.println("Directory is created!");
		} else {
			System.out.println("Failed to create directory!");
		}
	}

         file = new File("VehicleHai/"+t.getName()+"/PostAdvertisement");
	if (!file.exists()) {
		if (file.mkdir()) {
			System.out.println("Directory is created!");
		} else {
			System.out.println("Failed to create directory!");
		}
	}

         file = new File("VehicleHai/"+t.getName()+"/Profile");
	if (!file.exists()) {
		if (file.mkdir()) {
			System.out.println("Directory is created!");
		} else {
			System.out.println("Failed to create directory!");
		}
	}


    }

}
